import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/login.vue'
import Main from '../views/main.vue'
import User from '../views/sys/user/index.vue'
import Roles from '../views/sys/role/index.vue'
import Depts from '../views/sys/dept/index.vue'
import Menu from '../views/sys/menu/index.vue'
import Pos from '../views/sys/pos.vue'
import Dic from '../views/sys/dic.vue'
import Timetask from '../views/sys/timetask.vue'
import Operatelog from '../views/sys/operatelog.vue'
import Loginlog from '../views/sys/loginlog.vue'


import Ordermgr from '../views/salmgr/ordermgr.vue'

import Data from '../views/sys/data.vue'
import Managed from '../views/sys/managed.vue'
import First from '../views/sys/first.vue'


import Gift from '../views/gg/gifts/gift.vue'
import Gift2goods from '../views/gg/gifts/gift2goods.vue'
import Gift2GoodsVerify from '../views/gg/gifts/gifts2goodsVerify.vue'
import Goods2Gift from '../views/gg/gifts/goods2gift.vue'
import Goods2giftVerify from '../views/gg/gifts/goods2giftVerify.vue'

import Product from '../views/gg/goods/product.vue'
import Goods from '../views/gg/goods/goods.vue'
import GoodsTypes from '../views/gg/goods/goodsTypes.vue'
import Brand from '../views/gg/goods/brand.vue'
import Supplier from '../views/gg/goods/supplier.vue'
import Pricechange from '../views/gg/goods/pricechange.vue'
import Pricechangeverify from '../views/gg/goods/pricechangeVerify.vue'

import Delivery from '../views/salmgr/delivery.vue'
import Repairplacemgr from '../views/aftersalemgr/repairplacemgr.vue' //维修点管理
import Process from '../views/sys/process.vue'
import Returnandreplace from '../views/aftersalemgr/return_replace.vue'
import Activityapplication from '../views/activitymgr/activity.vue'
import Activityapplicationverify from '../views/activitymgr/activityVerify.vue'
import ProductReturn from '../views/aftersalemgr/productReturn.vue'

import axios from "axios";
axios.defaults.withCredentials = true


Vue.use(VueRouter)

const routes = [
	{
		path: '/',
		redirect: '/login'
	},
	{
		path: '/login',
		component: Login
	},
	{
		path: '/main',
		component: Main,
		children: [{
				path: '/users',
				component: User
			},
			{
				path: '/roles',
				component: Roles
			},
			{
				path: '/depts',
				component: Depts
			},
			{
				path: '/pos',
				component: Pos
			},
			{
				path: '/dic',
				component: Dic
			},
			{
				path: '/oprateLog',
				component: Operatelog
			},
			{
				path: '/loginLog',

				component: Loginlog
			},
			{
				path: '/menu',
				component: Menu
			},
			{
				path: '/data',
				component: Data
			},
			{
				path: '/managed',
				component: Managed,
			},{
				path: '/first',
				component: First
			},{
				path: '/timetask',
				component: Timetask
			},
			{
				path: '/pricechangeverify',
				component: Pricechangeverify
			},{
				path: '/gift',
				component: Gift
			},{
				path: '/gift2goods',
				component: Gift2goods
			}, {
				path: '/gift2GoodsVerify',
				component: Gift2GoodsVerify
			},{
				path: '/goods2Gift',
				component: Goods2Gift
			},{
				path: '/goods2giftVerify',
				component: Goods2giftVerify
			},
			 {
			 	path: '/product',
			 	component: Product
			 },
			 {
			 	path: '/goods',
			 	component: Goods
			 },
			 {
			 	path: '/goodsTypes',
			 	component: GoodsTypes
			 },
			 {
			 	path: '/brand',
			 	component: Brand
			 },
			 {
			 	path: '/supplier',
			 	component: Supplier
			 },
			 {
			 	path: '/pricechange',
			 	component: Pricechange
			 }, {
			 	path: '/pricechangeverify',
			 	component: Pricechangeverify
			 },
			{
				path: '/Issuemgr',
				component: Delivery
			},{
				path: '/ordermgr',
				component: Ordermgr
			},{
				path: '/process',
				component: Process
			},{
				path: '/returnandreplaceverify',
				component: Returnandreplace
			},{
				path: '/activityapplication',
				component: Activityapplication
			},{
				path: '/repairplacemgr',
				component: Repairplacemgr
			},
			{
				path: '/activityapplicationverify',
				component: Activityapplicationverify
			},
			{
				path: "/returnandreplace",
				component: ProductReturn
			}
		]
	},


]

const router = new VueRouter({
	mode: "history",
	routes
})

export default router
